package com.dtream.nacos.controller;

import com.dtream.nacos.openfeig.DepositClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("Deposit")
public class DepositController {
    @Autowired
    private DepositClient depositClient;

    @RequestMapping(value = "/test1")
    public String test() {
        return depositClient.test();
    }

    @GetMapping(value = "/test2")
    public String test2() {
        return depositClient.test2();
    }

    @PostMapping(value = "/textNotory")
    public String textNotory(@RequestParam("content") String content) {
        return depositClient.textNotory(content);
    }

    @PostMapping(value = "/deployContract")
    public String deployContract() {
        return depositClient.deployContract();
    }

    /**
     * 部署合约
     */
    @PostMapping(value = "/callContract")
    public String callContract(@RequestParam("name") String name
            , @RequestParam("identity") String identity
            , @RequestParam() String contract) {
        return depositClient.callContract(name, identity, contract);
    }
    /**
     * 执行合约
     */
}
